/**
 * Package:com.goldcitynet.robot;
 * $Id: Logout.java,v 1.1.1.1 2009/03/23 09:31:14 zhangpei Exp $
 * Copyright(c) 2001-2005 www.afteryuan.com
 */
package com.afteryuan.robot;

import javax.swing.*;

/**
 * Logout
 * <p/>
 * <p><a href="Logout.java.html"><i>View Source</i></a></p>
 *
 * @author <a href="mailto:afteryuan@afteryuan.com">$Author: zhangpei $</a>
 * @version $Revision: 1.1.1.1 $
 */
public class Logout {
    private int bufferLine = 500;
    private int currentLine = 0;
    JTextPane logTextPanel;

    public Logout(JTextPane logTextPanel) {
        this.logTextPanel = logTextPanel;
    }

    public void appendLog(String log) {
        if (currentLine > bufferLine) {
            currentLine=0;
            logTextPanel.setText("\n" + log);
        }else{
            logTextPanel.setText(log+"\n" + logTextPanel.getText() );
        }
        currentLine++;
    }
}
